Bag forming and filling machines are well known in the art and one of the problems with such machinery has been to so control the bag length that variations in the density of the product will not show up in the form of bags incompletely filled, a condition which is especially irritating to consumers. Premarking the sheet material on which the bags are to be formed with indicia spaced according to the calculated bag length required to hold the product and employing a sensing device, for example, a photoelectric device, to stop and start the feed as determined by the spacing of the indicia as shown, for example, in U.S. Pat. No. 4,077,308 does not solve the problem because this does not take into account the change in density of the product. Manually adjusting the feed from time to time to compensate for the changes in density of the product interrupts operation, requires constant supervision, is time-consuming and is not accurately consistent. It is the purpose of this invention to automatically control bag length according to the level of product in the bag.